package gat.common.enums;

import java.util.stream.Stream;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @auther ws
 * 角色类型枚举
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum UserRoleTypeEnum {
    SYSTEM_ROLE(0,"系统角色"),
    SELF_BUILT_ROLE(1,"自建角色");


    private Integer value;
    private String description;


    public static UserRoleTypeEnum toType(int value) {
        return Stream.of(UserRoleTypeEnum.values())
                .filter(p -> p.value == value)
                .findAny()
                .orElse(null);
    }

}
